var groupTabs = {
    template: '#groupTabs',
    data() {
      return { 
       tabs: [
          "成员",
          "文件",
        ],
     
        groupId:'',
        groupName:'',
        tabIndex: 0,
      }
    },
    beforeDestroy() {
        if(!eventBus.isback){
            this.setCatch()
        }else{
            this.clean()
        }
    },
    methods: {
        clean(){
            mapCatch.set('#groupTabs', {
            })
        },
        setCatch(){
        mapCatch.set('#groupTabs', {
            tabIndex:this.tabIndex,
            groupId:this.groupId,
            groupName:this.groupName
        })
    },
      onTabClick(index) {
        this.tabIndex = index
             if (index==0) {
                    this.$router.replace({
                        name: 'groupNumber',
                        params: {
                            groupId: this.groupId,
                            groupName: this.groupName
                        }
                    })
                } else {
                    this.$router.replace({
                        name: 'groupMd',
                        params: {
                            groupId: this.groupId,
                            groupName: this.groupName
                        }
                    })
                }
      },
      back(){  
            $router.go('-1')
      },
      
    },
    mounted() {
        let cacth = mapCatch.get('#groupTabs')
        if (cacth &&cacth.groupId) {
            this.tabIndex = cacth.tabIndex,
            this.groupId = cacth.groupId;
            this.groupName = cacth.groupName;
            eventBus.isback=true
            return
        }
        if(this.$route.params.groupId)
        this.groupId=this.$route.params.groupId
        if(this.$route.params.groupName)
        this.groupName=this.$route.params.groupName
    },
  }